dbatools

The PowerShell toolkit for SQL Server professionals

Automate administration, migrations, disaster recovery and compliance

PowerShell
PS C:\Projects\Migration> Start-DbaMigration @params

Performing instance migration
    Migrating databases
    [oooooooooooooooo                                                 ]
Type                              Name
----                              ----
Database Certificate              AGCertificate2021_2121
Custom error                      60000:'us_english'
Mail Configuration                Server Configuration
Mail Account                      The DBA Team
Mail Profile                      The DBA Team
Mail Server                       smtp.ad.local
CMS Group                         Production
CMS Instance                      SQL Server 2005 Ent
CMS Instance                      SQL Server 2005
CMS Instance                      SQL Server 2008 R2 Instance
CMS Instance                      SQL Server 2008
CMS Instance                      SQL Server 2012
CMS Group                         Test
CMS Instance                      SQL Server 2000 Dev
CMS Instance                      SQL Server 2005 Express Instance
CMS Instance                      The 2008 Clustered Instance
Server Trigger                    tr_MScdc_db_ddl_event

dbatools is a free, open-source PowerShell module with 600+ commands for SQL Server automation. Manage one instance or thousands with simple, consistent commands.

Trusted by enterprise teams worldwide

Nike United Nations Coca-Cola Walmart BMW
Dell Intuit Hilton Ticketmaster Stackoverflow

What you can do with dbatools

From daily operations to critical projects

🚀

Start-DbaMigration

Migrate entire SQL Server instances in minutes, not days

📸

Export-DbaInstance

Capture complete instance configurations for disaster recovery

Test-DbaLastBackup

Verify every backup actually restores before you need it

🔒

Start-DbaDbEncryption

Enable TDE encryption without manual certificate management

🔄

Invoke-DbaDbLogShipping

Set up log shipping for minimal downtime migrations

Update-DbaInstance

Automate SQL Server patching across your entire estate

Ready to automate your SQL Servers?

Install dbatools and get started in seconds.
Works on Windows, Linux, and macOS.

# Install
Install-Module dbatools

# Check who's connected right now
Get-DbaProcess -SqlInstance sql01
From Manning Publications

Learn dbatools in a Month of Lunches

Automating SQL Server tasks with PowerShell commands

The official guide written by dbatools creator Chrissy LeMaire and core contributors Rob Sewell, Jess Pomfret, and Cláudio Silva. Master SQL Server automation in 28 practical bite-sized lessons—each about 30 minutes.

Instance-to-instance and customized migrations
Security audits and alerting
SQL Server Agent task automation
Bulk data import and HA/DR

Pages

400

Published

May 2022

Amazon Rating

4.9★

Also available: Print • eBook • Audio • Manning Subscription

Learn dbatools in a Month of Lunches book cover

ISBN: 9781617296703

Latest Articles

Tips, guides, and updates from the dbatools community

August 5, 2025

dbatools is moving to Azure Trusted Signing

TLDR: dbatools is moving to Azure Trusted Signing, which means Microsoft backs our reputation and dbatools won’t trigger as many antivirus false positives. Users upgrading from older signed versions will need -SkipPublisherCheck only once during the initial transition. PowerShell users with strict ExecutionPolicies (AllSigned/RemoteSigned) will need to trust each new certificate after every update due to Azure Trusted Signing’s daily cert rotation (but you can use the automation script provided below).

Read more

September 21, 2023

Update-Module dbatools Authenticode Issuer Error

TLDR: This error is expected and the change is legitimate. To update, switch to Install-Module, then slap on the -SkipPublisherCheck and -Force parameters and continue your update. Install-Module dbatools -Force -SkipPublisherCheck I’ve always been very proud that dbatools is Code Signed like a “real” application. These certs prove the identity of the creator and help prevent tampering. The certificates cost a bunch of money and are hard to obtain. You gotta send in tons of paperwork, including your passport and business papers.

Read more

April 5, 2023

Offline Installation of dbatools 2.0 with the dbatools.library Dependency

If you work in an offline environment, you’re probably familiar with how painful it can be to install anything, including PowerShell modules like dbatools. In the past, dbatools had no dependencies, so the installation process was somewhat straightforward — you could even download a zip from our GitHub repo. However, with the introduction of the new dbatools.library dependency, the installation process has become a smidge more complex. In this post, I’ll walk you through the steps to install dbatools (and with it, dbatools.

Read more

April 5, 2023

Offline Installation of dbatools 2.0 with the dbatools.library Dependency

If you work in an offline environment, you’re probably familiar with how painful it can be to install anything, including PowerShell modules like dbatools. In the past, dbatools had no dependencies, so the installation process was somewhat straightforward — you could even download a zip from our GitHub repo. However, with the introduction of the new dbatools.library dependency, the installation process has become a smidge more complex. In this post, I’ll walk you through the steps to install dbatools (and with it, dbatools.

Read more

March 5, 2023

What's new and different in dbatools 2.0

So much is new and different! If you’d like to try it while you read this blog post, you can currently install dbatools 2.0 by executing the following command: Install-Module dbatools Requirements dbatools still works on PowerShell v3 an v4! Thanks to Microsoft for making that possible with SMO. PowerShell v5.1 is still supported, of course. That’s what I use and develop on. But when it comes to PowerShell v7, we did up the requirements to 7.

Read more

May 24, 2022

Import-DbaCsv Design Considerations

This post is about Import-DbaCsv, a command within the dbatools PowerShell module for SQL Server. I’ve been writing about CSV imports using PowerShell for a pretty long time and in VBScript for even longer. Initially, my primary concerns were ease-of-use and speed. Over time, I realized that what mattered most was: Ease-of-use Reliability Data quality management I learned a ton about performance from my speed experiments but in the end, I threw most of that out in favor of a higher quality and mildly slower solution using a .

Read more

Community ❤️ dbatools

Jeffrey Snover

Jeffrey Snover

PowerShell Inventor, Technical Fellow

If you use SQL, someone on the team should be a dbatools pro.

Steve Jones

Steve Jones

MVP & SQLServerCentral.com

If you haven't played with dbatools, I'd recommend you do so; it makes working with SQL and PowerShell much easier.

Argenis Fernandez

Argenis Fernandez

Microsoft, MCM, vExpert

I can't stress enough how good dbatools is. Stop doing it the hard way.

Anthony Nocentino

Anthony Nocentino

MVP, Author, Speaker

It's impossible to quantify the impact this project has had on our community and the tech that we work with. Everyone I introduce to dbatools is blown away by how much this enables productivity and allows DBAs to scale with their systems.

Joey D'Antoni

Joey D'Antoni

MVP, vExpert, DCAC

dbatools is an amazing project. Tasks like server migrations that used to take me hours can now be completed in seconds, and with total confidence.

Gianluca Sartori

Gianluca Sartori

Data Platform MVP, Formula 1 DBA

dbatools is the best thing that happened to SQL Server in the last 5 years.

Jeffery Hicks

Jeffery Hicks

MVP, Author

If you are a SQL person you need to check out the dbatools PowerShell project.

Mike Martin

Mike Martin

Technical Evangelist, Microsoft

If there was a thing such as MVP for MVP'S then dbatools would probably win it.

André Kamman

André Kamman

MVP & Dutch PASS Chapter Leader

dbatools are the most important PowerShell scripts for SQL Server DBAs.

Nikhil Chintalapudi

Nikhil Chintalapudi

SQL Server DBA

Thank you for this module. It's very helpful for a someone like me trying to automate database tasks without very much PowerShell experience.

Michael J Swart

Michael J Swart

Data Platform MVP

This dev just used dbatools to install and migrate 50 db machines at once with little effort or errors. It's truly the easy button.

Andy Nakamura

Andy Nakamura

SQL Saturday Speaker

I had been seriously thinking of quitting the SQL space altogether and decided to get into other things, but this has got to be a great addition to becoming a better DBA.

An open-source community you can trust

Join millions of users and hundreds of contributors shaping the future of SQL Server automation, built by the community for the community since 2014.